package org.zhaozhen.basic.util;

import lombok.Data;

@Data
public class AjaxResult {
    private Boolean success = true;
    private String message = "操作成功！";
    //用来接收一些后端返回的附加数据
    private Object resultObj;

    /**创建我自己 默认是成的*/
    public static AjaxResult me(){
        return new AjaxResult();
    }

    /**链式编程思维*/
    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }
    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }

}
